#include<bits/stdc++.h>
using namespace std;
long long n;
int a[20];
int main(){
	cin >> n;
	int cnt = 0;
	if(n == 0){
		cout << "00" << endl;
		return 0;
	}
	while(n){
		a[++cnt] = n & ((1 << 7) - 1);
		a[cnt] += 1 << 7;
		n >>= 7;
	}
	a[cnt] -= (1 << 7);
	for(int i = 1 ; i <= cnt ; i++){
		int a1 = a[i] / 16;
		int a2 = a[i] % 16;
		if(a1 <= 9){
			cout << a1;
		}
		else{
			cout << char(a1 - 10 + 'A');
		}
		if(a2 <= 9){
			cout << a2;
		}
		else{
			cout << char(a2 - 10 + 'A');
		}
		cout << " ";
	}
	return 0;
}
